Improved testability of socket code#88
Open
VonRehberg wants to merge 7 commits intoPatrickJS:masterfrom
Open
Conversation
…tention more clear
…e in socketBackendMock
this should avoid memory leaks if the webserver is not available added a test on reconnects to the howToTest package
|
I was using angular-websocket and when I tried to test my service that use the lib I realized that a lot of functionality was not implemented in the mock. So I started adding them when I bumped into your pull request. I implemented my service's test cases using your mock's version and they run very well. Thanks for sharing your work. |
Author
|
Thanks a lot for your feedback! |
|
This PR is great! I hope this gets some attention and makes it into a release. |
mikedaly
reviewed
Oct 18, 2017
| (function (global, factory) { | ||
| if (typeof define === "function" && define.amd) { | ||
| define(['module', 'angular'], factory); | ||
| define(["module", "angular"], factory); |
There was a problem hiding this comment.
Not sure why the quoting style changed. Single-quote seems to be more standard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I implemented automatical notification of listeners, so that the test code does not need to have access to the productive socket instance to invoke the listeners.
Additionally it is now possible to fake a socket close and a message initialized by the backend.